﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Configuration;

namespace WMS.App
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {   
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(GetStartForm());
        }

        static Form GetStartForm()
        {
            if (string.IsNullOrEmpty(ConfigurationManager.AppSettings["startForm"]))
            {
                return new frmLogin();
            }
            string assemblyName = ConfigurationManager.AppSettings["startForm"].Split(',')[1];
            string formName = ConfigurationManager.AppSettings["startForm"].Split(',')[0];
            System.Reflection.Assembly ass = System.Reflection.Assembly.Load(assemblyName);
            object obj = ass.CreateInstance(formName);
            return (Form)obj;
        }
    }
}
